package com.lizhi.yun.core.parameters.controller;/**
 * @program: sfrobot-html
 * @name UppParametersController
 * @description:
 * @author: lizhi
 * @create: 2020-04-23 14:22
 */

import com.lizhi.common.yun.entity.ListResponseResult;
import com.lizhi.yun.db.pojo.UppParametersPOJO;
import com.lizhi.yun.core.parameters.handler.UppParametersHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 *@program: sfrobot-html
 *@name UppParametersController
 *@description:
 *@author: lizhi
 *@create: 2020-04-23 14:22
 */
@Slf4j
@RestController
@RequestMapping(value = "/api/upp/parameters")
public class UppParametersController {

    @Resource
    private UppParametersHandler uppParametersHandler;

    @PostMapping(path = "/doMain")
    public ListResponseResult doMain(@RequestParam Map<String,Object> map) {
        return uppParametersHandler.Main(map);
    }

    @PostMapping(path = "/selectById")
    public ListResponseResult selectById(String code) {
        return uppParametersHandler.selectById(code);
    }

    @PostMapping(path = "/doAdd")
    public ListResponseResult doAdd(@RequestBody UppParametersPOJO uppParametersPOJO) {
        return uppParametersHandler.Add(uppParametersPOJO);
    }

    @PostMapping(path = "/doUpdate")
    public ListResponseResult doUpdate(@RequestBody UppParametersPOJO uppParametersPOJO) {
        return uppParametersHandler.Update(uppParametersPOJO);
    }

    @PostMapping(path = "/doDelete")
    public ListResponseResult doDelete(String code) {
        return uppParametersHandler.doDelete(code);
    }
}
